package com.kavinz.algo.queue;

import com.kavinz.algo.list.DoublyLinkedList;

public class LinkedListQueue<E> {
	DoublyLinkedList<E> interalStorage = new DoublyLinkedList<E>();
	
	public int size()
	{
		return interalStorage.size();
	}
	public boolean isEmpty()
	{
		return interalStorage.isEmpty();
	}
	public void enqueue(E value)
	{
		interalStorage.add(interalStorage.size(), value);
	}
	public E dequeue()
	{
		return interalStorage.remove(0);
	}
	
	public static void main(String[] args) { 
		
		LinkedListQueue<String> queue = new LinkedListQueue<String>();
		
		queue.enqueue("a");
		queue.enqueue("b");
		queue.enqueue("c");
		
		System.out.println("dequeue:"+queue.dequeue()+";size:"+queue.size());
		System.out.println("dequeue:"+queue.dequeue()+";size:"+queue.size());
		System.out.println("dequeue:"+queue.dequeue()+";size:"+queue.size());
	}

}
